<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>培训签到</title>
	<link rel="shortcut icon" href="/logo-gfs.png" type="image/x-icon">
	<link href="/sysServer/images/css/antd.min.css" rel="stylesheet">
</head>
<body>
<div id="index">
	<div style="text-align:center;margin-top:10%;font-size: 18px;" v-if="isOk=='Y'">签到成功!</div>
	<div style="text-align:center;margin-top:10%;font-size: 18px;color:red" v-else-if="isOk=='N'">签到失败! {{ msg }}</div>
</div>
</body>
<script type="text/javascript" src="/sysServer/images/js/vue.js"></script>
<script type="text/javascript" src="/sysServer/images/js/jquery.js"></script>
<script type="text/javascript" src="/sysServer/images/js/axios.min.js"></script>

<script>
	var indexVue = new Vue({
		el: '#index',
		data: {
			isOk: '',
            msg:'',
		},
		mounted: function () {
		},
		created(){
            let code = "${(parameters.code)!}";
            let courseId = "${(parameters.state)!}";

            this.createTrain(code,courseId);
        },
		methods: {
			createTrain(code,courseId) {
				axios.post('special/api/createHrCourseAttendaceWx', {
                    code: code,
                    courseId:courseId,
				}).then(response => {
					console.log(response)
					let rcode = response.data.code;
                    let message = response.data.message;
					if(rcode!="0"){
						this.isOk = 'N';
						this.msg = message;
					}else{
						this.isOk = 'Y';
					}
				}).catch(function (error) {
					console.log(error);
				});
			},
		}
	})
</script>

</html>